package com.zb.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zb.entity.ZjFactoryUser;
import com.zb.extend.FactoryUserExtend;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * 厂商用户表 Mapper 接口
 * </p>
 *
 * @author WEN
 * @since 2024-03-27
 */
@Repository
public interface ZjFactoryUserMapper extends BaseMapper<ZjFactoryUser> {

    /**
     * 根据品牌商家ID & 用户ID查询是已存在
     * @param factoryId 品牌商家ID
     * @param userId 用户ID
     */
    Integer existByFactoryIdAndUserId(@Param("factoryId") Long factoryId, @Param("userId") Long userId);

    /**
     * 根据客户ID获取关联的品牌厂商
     * @param userIds 客户ID
     * @return
     */
    List<FactoryUserExtend> getByUserIds(@Param("userIds") List<Long> userIds);
}
